package com.mjk.common.ai.work.admin;

import com.mjk.common.ai.dto.ConvEditReq;
import com.mjk.common.ai.dto.ConvSearchReq;
import com.mjk.common.ai.service.ConversationService;
import com.mjk.common.base.error.BeeError;
import com.mjk.common.base.response.BeeResponse;
import com.mjk.common.base.work.BaseWork;
import com.mjk.common.base.work.annotation.BeeWork;
import jakarta.annotation.Resource;

/**
 * 聊天会话管理
 */
@BeeWork(work = "conv")
public class AdminConvWork extends BaseWork {

    @Resource
    private ConversationService conversationService;

    public BeeResponse getConvList(ConvSearchReq req) {
        return BeeError.BEE_SUC.tranceError(conversationService.search(req, req.getPageStart(), req.getPageSize()));
    }


    public BeeResponse editConv(ConvEditReq req) {
        conversationService.edit(req);
        return BeeError.BEE_SUC.tranceError();
    }

    public BeeResponse softDel(ConvEditReq req) {
        conversationService.softDel(req.getUuid());
        return BeeError.BEE_SUC.tranceError();
    }
}
